<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<table class="cntable table table-bordered dataTable table-employee">
	<thead>
		<tr>
			<th style="width:50px">序号</th>
			<th data-sortable="true" data-field="experimentName" style="width:130px">实验名称</th>
			<th data-sortable="true" data-field="experimentDate" style="width:130px">实验日期</th>
			<th data-sortable="true" data-filed="employeeId" style="width:100px">负责人</th>
			<th data-sortable="true" data-field="experimentAddress" style="width:80px">实验地点</th>
			<th data-field="experimentComment" style="width:100px">实验描述</th>
			<td style="width:100px">实验报告</td>
			<td style="width:100px">实验结果</td>
		</tr>
	</thead>
	<tbody>
	
		<c:forEach var="experiment" items="${experiments}" varStatus="status">
	 
			<tr data-id="${experiment.experimentId}">
				<td>${status.index+1}</td>
				<td>${experiment.experimentName}</td>
				<td><fmt:formatDate value="${experiment.experimentDate}" pattern="yyyy/MM/dd" /></td>
				<td>${experiment.employeeName}</td>
				<td>${experiment.experimentAddress}</td>
				<td>${experiment.experimentComment}</td>
				<c:if test="${experiment.experimentReportUUID =='' }" >
					<td style="color:red">未上传</td>
				</c:if>
				<c:if test="${experiment.experimentReportUUID !='' }">
					<td><a onclick="startDownload('${experiment.experimentReportUUID}')" href="#">下载</a></td>
				</c:if>
			</tr>
			
		</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<th class="pager-th">
				<%@ include file="/WEB-INF/views/shared/master/pager.jsp"%>
			</th>
		</tr>
	</tfoot>
</table>
<script type="text/javascript">
function startDownload(ossId){
	var url=$.getFileUrl(ossId);
	if($("#ossCommonDownload").length>0){
		$("#ossCommonDownload").attr("href",url);
	}else{
		var downloadHtml="<a id='ossCommonDownload' href='"+url+"' style='display:none;' target='_blank' />";
		$("body").append(downloadHtml);
	}
	$("#ossCommonDownload")[0].click();	
}
</script>